1. Field of the Invention
The present invention relates to a quantizer and more particularly to a quantizer for quantizing scanned Discrete Cosine Transform (DCT) coefficients in a video signal encoding system.
2. Description of the Prior Art
FIG. 1 shows a block diagram of a conventional MPEG-2 video encoder comprising a frame memory, a subtracter (SUB), a Discrete Cosine Transform unit (DCT unit), a quantizer (Q), a scanning unit, a Variable Length Coding unit (VLC unit), an inverse quantizer (IQ), an Inverse Discrete Cosine Transform unit (IDCT unit), an adder (ADD), and a motion compensator (MC).
In FIG. 1, a differential video signal between a current video signal from the frame memory and a previous video signal motion-compensated in the motion compensator is calculated in the subtracter, and outputted to the DCT unit. In the DCT unit, the differential video signal is converted into DCT coefficients. The DCT coefficients are quantized in the quantizer, and the quantized DCT coefficients are outputted to the scanning unit and the inverse quantizer. In the scanning unit, the quantized two-dimension DCT coefficient series are converted into one-dimension coefficient series, and are outputted to the VLC unit or a Run Length Coding unit (RLC unit) for generating a final coded bit-stream.
As described above, in the conventional MPEG-2 video encoder, the scanning is performed after the video data have been quantized. However, due to the problem of latency caused by the structural restraint of the conventional video encoder, there has been a need for video encoder in which the scanning is performed prior to quantization of the video signals.
FIG. 2 shows a differential circuit except a motion compensator of a video encoder in which the scanning is performed prior to quantization. The video encoder comprises a orthogonal transform unit, a scanning unit, a quantizer, and a coding unit. In the orthogonal transform unit, input video signals are converted by DCT. In the scanning unit, the converted two dimension DCT coefficients are converted into one dimension coefficient series to be quantized. In the coding unit, the quantized one-dimension coefficient series are coded by a VLC or a RLC to generate a coded bit-stream. The video encoder similar to the above is disclosed in U.S. Pat. No. 5,369,439.
In the MPEG-1 video encoder, the DCT coefficients, as shown in FIG. 3A, are converted to the one dimension coefficient series by a zigzag scanning. An alternate scanning, as shown in FIG. 3B, or the zigzag scanning may be used selectively in picture units in the MPEG-2 video encoder. This alternate scanning can also be efficiently used in an interlaced scanning screen.
However, as shown in FIG. 2, when the scanning is performed before quantization, the quantizer must provide quantization matrixes corresponding to the zigzag and alternate scanning manner of the scanning unit. In MPEG-2 video encoder, the quantization is of adaptive quantization, since a weighted value is changed according to a spatial frequency. Accordingly, a matrix for quantizing an intra block (intra quantization matrix) and a matrix for quantizing, an inter block (inter quantization matrix) are required according to the coding mode. In the quantizer, only the zigzag manner is required for an input order of the matrix, however, an input order of video data changes by the scanning manner. Accordingly, in order to quantize the scanned DCT coefficients, the order of quantization matrix should correspond with the order of input video data affected by the scanning manner. Particularly, input video data couples should match quantization matrix couples when processing two pixels by 16 bits for a fast video coding in the quantizer.